package com.zy.mc_module.ui.micang.adapter;

import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.NonNull;

import com.zy.mc_module.base.kotlin.BaseAdapter;
import com.zy.mc_module.base.kotlin.BaseViewHolder;
import com.zy.mc_module.databinding.ItemActiveDetailBinding;
import com.zy.mc_module.databinding.ItemRiceIncomeDetailBinding;
import com.zy.mc_module.mvp.bean.UserActiveBean;

import java.util.List;

public class ActiveDetailAdapter extends BaseAdapter<ItemActiveDetailBinding, UserActiveBean> {
    public ActiveDetailAdapter(@NonNull List<UserActiveBean> mData) {
        super(mData);
    }

    @NonNull
    @Override
    public ItemActiveDetailBinding getViewBinding(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
        return ItemActiveDetailBinding.inflate(inflater,parent,false);
    }

    @Override
    protected void onMyBindViewHolder(@NonNull BaseViewHolder<ItemActiveDetailBinding> holder, int position) {
        String[] type = {"兑换米仓","米仓失效"};
        UserActiveBean bean = getList().get(holder.getAdapterPosition());
        holder.getBinding().activeDetailItemNum.setText("+" + bean.getActiveNum());
        holder.getBinding().activeDetailItemTime.setText(bean.getCreateTime());
        holder.getBinding().activeDetailItemType.setText(type[bean.getActiveType() % 2]);

    }
}
